﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="pr.aspx.vb" Inherits="str_pr" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style1 {
            width: 365px;
            text-align: right;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
          <asp:TextBox ID="lblLogs" runat="server" Visible="False">Failed</asp:TextBox>
          <br />
    <table style="width:100%;">
        <tr>
            <td class="auto-style1">PR Number:</td>
            <td>
                <asp:TextBox ID="txtPrNumber" runat="server" CssClass="textbox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtPrNumber" Display="None" ErrorMessage="* PR Number is required"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">Company :</td>
            <td>
                      <asp:DropDownList ID="ddlCompany" runat="server" CssClass="textbox">
                          <asp:ListItem>Select Company</asp:ListItem>
                          <asp:ListItem Value="KR">EPEI</asp:ListItem>
                          <asp:ListItem Value="SBC">CMI</asp:ListItem>
                          <asp:ListItem Value="KG">GBC</asp:ListItem>
                          <asp:ListItem Value="DGB">Dream Gastro</asp:ListItem>
                          <asp:ListItem Value="HO">HEAD OFFICE</asp:ListItem>
                      </asp:DropDownList>
                      </td>
        </tr>
        <tr>
            <td class="auto-style1">Requisitioner :</td>
            <td>
                <asp:TextBox ID="txtrequisitionName" runat="server" CssClass="textbox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtrequisitionName" Display="None" ErrorMessage="* Requisitioner  is required"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">ApprovedBy :</td>
            <td>
                <asp:TextBox ID="txtApprovedBy" runat="server" CssClass="textbox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtApprovedBy" Display="None" ErrorMessage="* Approved By  is required"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">Status :</td>
            <td>
                <asp:CheckBox ID="CheckBox1" runat="server" Checked="True" />
            </td>
        </tr>
        <tr>
            <td class="auto-style1">Comment :</td>
            <td>
                <asp:TextBox ID="txtComment" runat="server" CssClass="textbox"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">&nbsp;</td>
            <td>
                <asp:Button ID="Button1" runat="server" Text="Add" Width="122px" CssClass="button" />
            </td>
        </tr>
    </table>
    <br />
          <table style="width:100%;">
              <tr>
                  <td>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" DeleteCommand="DELETE FROM [pr_header] WHERE [prid] = @prid" InsertCommand="INSERT INTO [pr_header] ([PrNumber], [Company], [RequisitionName], [ApprovedBy], [Status], [Comment], [TimeStamp], [UploadedBy]) VALUES (@PrNumber, @Company, @RequisitionName, @ApprovedBy, @Status, @Comment, @TimeStamp, @UploadedBy)" SelectCommand="SELECT * FROM [pr_header]" UpdateCommand="UPDATE [pr_header] SET [PrNumber] = @PrNumber, [Company] = @Company, [RequisitionName] = @RequisitionName, [ApprovedBy] = @ApprovedBy, [Status] = @Status, [Comment] = @Comment, [TimeStamp] = @TimeStamp, [UploadedBy] = @UploadedBy WHERE [prid] = @prid">
        <DeleteParameters>
            <asp:Parameter Name="prid" Type="Int64" />
        </DeleteParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="txtPrNumber" Name="PrNumber" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="ddlCompany" Name="Company" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="txtrequisitionName" Name="RequisitionName" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="txtApprovedBy" Name="ApprovedBy" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="CheckBox1" Name="Status" PropertyName="Checked" Type="Boolean" />
            <asp:ControlParameter ControlID="txtComment" Name="Comment" PropertyName="Text" Type="String" />
            <asp:SessionParameter Name="TimeStamp" SessionField="TimeStamp" Type="String" />
            <asp:SessionParameter Name="UploadedBy" SessionField="IdentityName" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="PrNumber" Type="String" />
            <asp:Parameter Name="Company" Type="String" />
            <asp:Parameter Name="RequisitionName" Type="String" />
            <asp:Parameter Name="ApprovedBy" Type="String" />
            <asp:Parameter Name="Status" Type="Boolean" />
            <asp:Parameter Name="Comment" Type="String" />
            <asp:Parameter Name="TimeStamp" Type="String" />
            <asp:Parameter Name="UploadedBy" Type="String" />
            <asp:Parameter Name="prid" Type="Int64" />
        </UpdateParameters>
    </asp:SqlDataSource>
                  </td>
                  <td>
                      <asp:SqlDataSource ID="GetPODataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" SelectCommand="SELECT [po_description] FROM [pr_rcpt]"></asp:SqlDataSource>
                  </td>
              </tr>
              <tr>
                  <td>
          <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" DeleteCommand="DELETE FROM [pr_header] WHERE [prid] = @prid" InsertCommand="INSERT INTO [pr_header] ([PrNumber], [Company], [RequisitionName], [ApprovedBy], [Status], [Comment], [TimeStamp], [UploadedBy]) VALUES (@PrNumber, @Company, @RequisitionName, @ApprovedBy, @Status, @Comment, @TimeStamp, @UploadedBy)" SelectCommand="SELECT * FROM [pr_header]" UpdateCommand="UPDATE [pr_header] SET [PrNumber] = @PrNumber, [Company] = @Company, [RequisitionName] = @RequisitionName, [ApprovedBy] = @ApprovedBy, [Status] = @Status, [Comment] = @Comment, [TimeStamp] = @TimeStamp, [UploadedBy] = @UploadedBy WHERE [prid] = @prid">
              <DeleteParameters>
                  <asp:Parameter Name="prid" Type="Int64" />
              </DeleteParameters>
              <InsertParameters>
                  <asp:ControlParameter ControlID="txtPrNumber" Name="PrNumber" PropertyName="Text" Type="String" />
                  <asp:ControlParameter ControlID="ddlCompany" Name="Company" PropertyName="SelectedValue" Type="String" />
                  <asp:ControlParameter ControlID="txtrequisitionName" Name="RequisitionName" PropertyName="Text" Type="String" />
                  <asp:ControlParameter ControlID="txtApprovedBy" Name="ApprovedBy" PropertyName="Text" Type="String" />
                  <asp:ControlParameter ControlID="CheckBox1" Name="Status" PropertyName="Checked" Type="String" />
                  <asp:ControlParameter ControlID="txtComment" Name="Comment" PropertyName="Text" Type="String" />
                  <asp:SessionParameter Name="TimeStamp" SessionField="TimeStamp" Type="String" />
                  <asp:SessionParameter Name="UploadedBy" SessionField="IdentityName" Type="String" />
              </InsertParameters>
              <UpdateParameters>
                  <asp:Parameter Name="PrNumber" Type="String" />
                  <asp:Parameter Name="Company" Type="String" />
                  <asp:Parameter Name="RequisitionName" Type="String" />
                  <asp:Parameter Name="ApprovedBy" Type="String" />
                  <asp:Parameter Name="Status" Type="String" />
                  <asp:Parameter Name="Comment" Type="String" />
                  <asp:Parameter Name="TimeStamp" Type="String" />
                  <asp:Parameter Name="UploadedBy" Type="String" />
                  <asp:Parameter Name="prid" Type="Int64" />
              </UpdateParameters>
          </asp:SqlDataSource>
                  </td>
                  <td>
                <asp:SqlDataSource ID="POSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:NAV FOODConnectionString %>" SelectCommand="SELECT Type, [Document No_] AS Document_No_, Description, [Unit of Measure] AS Unit_of_Measure, [Direct Unit Cost] AS Direct_Unit_Cost, [Line Amount] AS Amount, [Line No_] AS Line_No_, Quantity AS Quantity_ FROM [Epicurean Partners Exchange$Purchase Line] WHERE ([Document No_] = @Document_No_) ORDER BY Line_No_">
                    <SelectParameters>
                        <asp:SessionParameter Name="Document_No_" SessionField="PONumber" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                  </td>
              </tr>
              <tr>
                  <td>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:NAV FOODConnectionString %>" SelectCommand="SELECT [Buy-from Vendor No_] AS column1, [Order Date] AS Order_Date, [Shortcut Dimension 1 Code] AS Shortcut_Dimension_1_Code, [Purchaser Code] AS Purchaser_Code, [Posting Description] AS Posting_Description, [Extended Description] AS Extended_Description, No_ FROM [Epicurean Partners Exchange$Purchase Header] WHERE ([Extended Description] LIKE '%' + @Extended_Description + '%')">
            <SelectParameters>
                <asp:ControlParameter ControlID="txtPrNumber" Name="Extended_Description" PropertyName="Text" Type="String" />
            </SelectParameters>
    </asp:SqlDataSource>
         
    
                  </td>
                  <td>&nbsp;</td>
              </tr>
          </table>
    <br />
         
    
    <br />
</asp:Content>

